<?php
namespace App\Constant;
abstract class HttpStatus
{
    const OK = 200;
    const CREATED = 201;
    const NO_CONTENT = 204;
    const BAD_REQUEST = 400;
    const UNAUTHORIZED = 401;
    const FORBIDDEN = 403;
    const NOT_FOUND = 404;
    const EXISTIMG_USER  = 409;
    const INTERNAL_SERVER_ERROR = 500;

    public static function getStatusMessage($statusCode)
    {
        switch ($statusCode) {
            case self::OK:
                return '成功';
            case self::CREATED:
                return '已创建';
            case self::NO_CONTENT:
                return '无内容';
            case self::BAD_REQUEST:
                return '错误请求';
            case self::UNAUTHORIZED:
                return '未授权';
            case self::FORBIDDEN:
                return '禁止访问';
            case self::NOT_FOUND:
                return '未找到';
            case self::INTERNAL_SERVER_ERROR:
                return '内部服务器错误';
            case self::EXISTIMG_USER:
                return '已有用户，存在冲突';


            default:
                return '未知状态';
        }
    }
}
